﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace controlMy
{
    namespace mode
    {
        enum keym { Rus, RusBig, Eng, EngBig }
        enum press { CTRL, CTRL_ALT, ALT, ALT_SHIFT, SHIFT, Enter, KeyLeft, KeyRight, DEL, HOME, END, other }
    }

    public partial class UserControlKey2 : UserControl
    {
        public delegate void funcd(object oCod);
        public delegate void IsEvent(object oKeyPress);
        funcd fo; IsEvent IsEventControl;

        mode.keym curMode;
        mode.press pressCurrent;
        string txt; bool IsPressShift;
        public bool IsEnter;
        public string valueEnter;
        public int currentPositionCursor;


        public UserControlKey2(funcd foo, IsEvent IsEventOut)
        {
            InitializeComponent(); InitializeComponentMy(); fo = foo; IsEventControl = IsEventOut;
        }
        private void InitializeComponentMy()
        {
            curMode = controlMy.mode.keym.Rus; pressCurrent = controlMy.mode.press.other; txt = ""; currentPositionCursor = 0; IsPressShift = false; IsEnter = false; valueEnter = "";
        }

        private void putTxt(string txto)
        {
            string s1 = "", s2 = "", s3 = "";
            if (currentPositionCursor == 0 || currentPositionCursor == txt.Length)
            {
                textBox1.Text = string.Concat(txt, txto); txt = textBox1.Text; fo(txt); pressCurrent = controlMy.mode.press.other; 
            }
            else
            {
                s1 = leftText(txt, currentPositionCursor); s2 = txto; s3 = rightText(txt,currentPositionCursor); 
                textBox1.Text = string.Concat(
                    s1, 
                    s2, 
                    s3);
                txt = textBox1.Text; fo(txt); pressCurrent = controlMy.mode.press.other;
            }
                            currentPositionCursor++;
                    IsEventControl((int)pressCurrent);
        }
        private string leftText(string stxt, int icc) 
        {
            int l = stxt.Length; string stxtLeft = stxt.Substring(0, icc); return stxtLeft;
        }
        private string rightText(string stxt, int icc)
        {
            int l = stxt.Length; string stxtRight = stxt.Substring(icc, l  - icc); return stxtRight;
        }

        private void backTxt()
        {
            string txto = textBox1.Text; int l = txto.Length; string s1, s2, s3;
            if (l > 0 && currentPositionCursor == l) 
            {
                txt = txto.Substring(0, l - 1); 
                textBox1.Text = txt; fo(txt); 
                
            }
            else if (currentPositionCursor < l && currentPositionCursor>0)
            {
                s1 = leftText(txto, currentPositionCursor); s3 = rightText(txto, currentPositionCursor);
                s2 = s1.Substring(0, s1.Length - 1); txt = string.Concat(s2, s3);

            }
            currentPositionCursor--;
            textBox1.Text = txt; fo(txt); 
            pressCurrent = controlMy.mode.press.other; IsEventControl((int)pressCurrent); 
        }
        public string VALUEKEY
        {
            get {return  textBox1.Text; }
        }


        #region fun for buttons
        private string b00
        {
            get
            {
                string s = "ё";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ё"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "`"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "~"; }
                return s;
            }
        }
        private string b1
        {
            get
            {
                string s = "1";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = "!"; } return s;
            }
        }
        private string b2
        {
            get
            {
                string s = "2";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = "@"; } return s;
            }
        }
        private string b3
        {
            get
            {
                string s = "3";
                if (curMode == controlMy.mode.keym.RusBig)
                { s = "№"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "#"; }
                return s;
            }
        }
        private string b4
        {
            get
            {
                string s = "4";
                if (curMode == controlMy.mode.keym.RusBig) { s = ";"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "$"; }
                return s;
            }
        }
        private string b5
        {
            get
            {
                string s = "5";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = "%"; } return s;
                return s;
            }
        }
        private string b6
        {
            get
            {
                string s = "6";
                if (curMode == controlMy.mode.keym.RusBig) { s = ";"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "$"; }
                return s;
            }
        }
        private string b7
        {
            get
            {
                string s = "7";
                if (curMode == controlMy.mode.keym.RusBig) { s = "?"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "&"; } return s;
            }
        }
        private string b8
        {
            get
            {
                string s = "8";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = "*"; } return s;
            }
        }
        private string b9
        {
            get
            {
                string s = "9";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = "("; } return s;
            }
        }
        private string b0
        {
            get
            {
                string s = "0";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = ")"; } return s;
            }
        }
        private string b10
        {
            get
            {
                string s = "-";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = "_"; } return s;
            }
        }
        private string b11
        {
            get
            {
                string s = "=";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = "+"; } return s;
            }
        }

        //====================второй ряд клавиатуры

        private string b111
        {
            get
            {
                string s = "\\";
                return s;
            }
        }
        private string b1b
        {
            get
            {
                string s = "й";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Й"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "q"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "Q"; }
                return s;
            }
        }
        private string b2b
        {
            get
            {
                string s = "ц";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ц"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "w"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "W"; }
                return s;
            }
        }
        private string b3b
        {
            get
            {
                string s = "у";
                if (curMode == controlMy.mode.keym.RusBig) { s = "У"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "e"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "E"; }
                return s;
            }
        }
        private string b4b
        {
            get
            {
                string s = "к";
                if (curMode == controlMy.mode.keym.RusBig) { s = "К"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "r"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "R"; }
                return s;
            }
        }
        private string b5b
        {
            get
            {
                string s = "е";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Е"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "t"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "T"; }
                return s;
            }
        }
        private string b6b
        {
            get
            {
                string s = "н";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Н"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "y"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "Y"; }
                return s;
            }
        }
        private string b7b
        {
            get
            {
                string s = "г";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Г"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "u"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "U"; }
                return s;
            }
        }
        private string b8b
        {
            get
            {
                string s = "ш";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ш"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "i"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "I"; }
                return s;
            }
        }
        private string b9b
        {
            get
            {
                string s = "щ";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Щ"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "o"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "O"; }
                return s;
            }
        }
        private string b10b
        {
            get
            {
                string s = "з";
                if (curMode == controlMy.mode.keym.RusBig) { s = "З"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "p"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "P"; }
                return s;
            }
        }
        private string b11b
        {
            get
            {
                string s = "х";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Х"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "["; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "{"; }
                return s;
            }
        }
        private string b12b
        {
            get
            {
                string s = "ъ";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ъ"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "]"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "}"; }
                return s;
            }
        }

        //===================третий ряд клавиш
        private void bTab()
        {
            if (curMode == controlMy.mode.keym.RusBig) { curMode = controlMy.mode.keym.Rus; }
            else if (curMode == controlMy.mode.keym.Eng) { curMode = controlMy.mode.keym.EngBig; }
            else if (curMode == controlMy.mode.keym.EngBig) { curMode = controlMy.mode.keym.Eng; }
            else if (curMode == controlMy.mode.keym.Rus) { curMode = controlMy.mode.keym.RusBig; }
        }
        private string b3_1
        {
            get
            {
                string s = "ф";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ф"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "a"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "A"; }
                return s;
            }
        }
        private string b3_2
        {
            get
            {
                string s = "ы";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ы"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "s"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "S"; }
                return s;
            }
        }
        private string b3_3
        {
            get
            {
                string s = "в";
                if (curMode == controlMy.mode.keym.RusBig) { s = "В"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "d"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "D"; }
                return s;
            }
        }
        private string b3_4
        {
            get
            {
                string s = "а";
                if (curMode == controlMy.mode.keym.RusBig) { s = "А"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "f"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "F"; }
                return s;
            }
        }
        private string b3_5
        {
            get
            {
                string s = "п";
                if (curMode == controlMy.mode.keym.RusBig) { s = "П"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "g"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "G"; }
                return s;
            }
        }
        private string b3_6
        {
            get
            {
                string s = "р";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Р"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "h"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "H"; }
                return s;
            }
        }
        private string b3_7
        {
            get
            {
                string s = "о";
                if (curMode == controlMy.mode.keym.RusBig) { s = "О"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "j"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "J"; }
                return s;
            }
        }
        private string b3_8
        {
            get
            {
                string s = "л";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Л"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "k"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "K"; }
                return s;
            }
        }
        private string b3_9
        {
            get
            {
                string s = "д";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Д"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "l"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "L"; }
                return s;
            }
        }
        private string b3_10
        {
            get
            {
                string s = "ж";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ж"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = ";"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = ":"; }
                return s;
            }
        }
        private string b3_11
        {
            get
            {
                string s = "э";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Э"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "'"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "'"; }
                return s;
            }
        }
        //================четв ряд клавиш
        private string b4_1
        {
            get
            {
                string s = "я";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Я"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "z"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "Z"; }
                return s;
            }
        }
        private string b4_2
        {
            get
            {
                string s = "ч";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ч"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "x"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "X"; }
                return s;
            }
        }
        private string b4_3
        {
            get
            {
                string s = "с";
                if (curMode == controlMy.mode.keym.RusBig) { s = "С"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "c"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "C"; }
                return s;
            }
        }
        private string b4_4
        {
            get
            {
                string s = "м";
                if (curMode == controlMy.mode.keym.RusBig) { s = "М"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "v"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "V"; }
                return s;
            }
        }
        private string b4_5
        {
            get
            {
                string s = "и";
                if (curMode == controlMy.mode.keym.RusBig) { s = "И"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "b"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "B"; }
                return s;
            }
        }
        private string b4_6
        {
            get
            {
                string s = "Т";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Т"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "n"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "N"; }
                return s;
            }
        }
        private string b4_7
        {
            get
            {
                string s = "ь";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ь"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "m"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "M"; }
                return s;
            }
        }
        private string b4_8
        {
            get
            {
                string s = "б";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Б"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = ","; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "<"; }
                return s;
            }
        }
        private string b4_9
        {
            get
            {
                string s = "ю";
                if (curMode == controlMy.mode.keym.RusBig) { s = "Ю"; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "."; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = ">"; }
                return s;
            }
        }
        private string b4_10
        {
            get
            {
                string s = ".";
                if (curMode == controlMy.mode.keym.RusBig) { s = ","; }
                else if (curMode == controlMy.mode.keym.Eng) { s = "/"; }
                else if (curMode == controlMy.mode.keym.EngBig) { s = "?"; }
                return s;
            }
        }
        private string b5_setLanguage
        {
            get
            {
                string s = "R";
                if (curMode == controlMy.mode.keym.Eng || curMode == controlMy.mode.keym.EngBig) { s = "E"; }
                else if (curMode == controlMy.mode.keym.Rus || curMode == controlMy.mode.keym.RusBig) { s = "R"; }
                return s;
            }
        }
        private string b5_setLevel
        {
            get
            {
                string s = "h";
                if (curMode == controlMy.mode.keym.RusBig || curMode == controlMy.mode.keym.EngBig) { s = "h"; }
                else if (curMode == controlMy.mode.keym.Rus || curMode == controlMy.mode.keym.Eng) { s = "i"; }
                return s;
            }
        }



        private string b_kav
        {
            get
            {
                string s = "`";
                
                return s;
            }
        }
        #endregion

        #region events

        private void button1_Click(object sender, EventArgs e)
        {
            putTxt(b00);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            putTxt(b1);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            putTxt(b2);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            putTxt(b3);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            putTxt(b4);
        }

        private void button10_Click(object sender, EventArgs e)
        {
            putTxt(b5);
        }

        private void button9_Click(object sender, EventArgs e)
        {
            putTxt(b6);
        }

        private void button8_Click(object sender, EventArgs e)
        {
            putTxt(b7);
        }

        private void button7_Click(object sender, EventArgs e)
        {
            putTxt(b8);
        }

        private void button6_Click(object sender, EventArgs e)
        {
            putTxt(b9);
        }

        private void button12_Click(object sender, EventArgs e)
        {
            putTxt(b0);
        }

        private void button14_Click(object sender, EventArgs e)
        {
            putTxt(b10);
        }

        private void button13_Click(object sender, EventArgs e)
        {
            putTxt(b11);
        }

        private void button11_Click(object sender, EventArgs e)
        {
            backTxt();//
        }




        //-------------------------2 row key
        private void button28_Click(object sender, EventArgs e)
        {
            putTxt(b111);
        }

        private void button26_Click(object sender, EventArgs e)
        {
            putTxt(b1b);
        }

        private void button25_Click(object sender, EventArgs e)
        {
            putTxt(b2b);
        }

        private void button24_Click(object sender, EventArgs e)
        {
            putTxt(b3b);
        }

        private void button23_Click(object sender, EventArgs e)
        {
            putTxt(b4b);
        }

        private void button22_Click(object sender, EventArgs e)
        {
            putTxt(b5b);
        }

        private void button21_Click(object sender, EventArgs e)
        {
            putTxt(b6b);
        }

        private void button20_Click(object sender, EventArgs e)
        {
            putTxt(b7b);
        }

        private void button19_Click(object sender, EventArgs e)
        {
            putTxt(b8b);
        }

        private void button18_Click(object sender, EventArgs e)
        {
            putTxt(b9b);
        }

        private void button17_Click(object sender, EventArgs e)
        {
            putTxt(b10b);
        }

        private void button16_Click(object sender, EventArgs e)
        {
            putTxt(b11b);
        }

        private void button15_Click(object sender, EventArgs e)
        {
            putTxt(b12b);
        }

        private void button63_Click(object sender, EventArgs e)
        {
            IsEventControl(controlMy.mode.press.DEL);
        }
        //---------------------------------3 row key
        private void button41_Click(object sender, EventArgs e)
        {
            bTab();
        }

        private void button40_Click(object sender, EventArgs e)
        {
            putTxt(b3_1);
        }

        private void button39_Click(object sender, EventArgs e)
        {
            putTxt(b3_2);
        }

        private void button38_Click(object sender, EventArgs e)
        {
            putTxt(b3_3);
        }

        private void button37_Click(object sender, EventArgs e)
        {
            putTxt(b3_4);
        }

        private void button36_Click(object sender, EventArgs e)
        {
            putTxt(b3_5);
        }

        private void button35_Click(object sender, EventArgs e)
        {
            putTxt(b3_6);
        }

        private void button34_Click(object sender, EventArgs e)
        {
            putTxt(b3_7);
        }

        private void button33_Click(object sender, EventArgs e)
        {
            putTxt(b3_8);
        }

        private void button32_Click(object sender, EventArgs e)
        {
            putTxt(b3_9);
        }

        private void button31_Click(object sender, EventArgs e)
        {
            putTxt(b3_10);
        }

        private void button30_Click(object sender, EventArgs e)
        {
            putTxt(b3_11);
        }

        private void button29_Click(object sender, EventArgs e)
        {
            IsEnter = true;
            valueEnter = textBox1.Text;
           // this.Close();
            IsEventControl(controlMy.mode.press.Enter);
            
        }



        //----------------------------------------4 row key
        private void button62_Click(object sender, EventArgs e)
        {
            setLevelHL();
        }

        private void button53_Click(object sender, EventArgs e)
        {

        }

        private void button52_Click(object sender, EventArgs e)
        {
            putTxt(b4_1);
        }

        private void button51_Click(object sender, EventArgs e)
        {
            putTxt(b4_2);
        }

        private void button50_Click(object sender, EventArgs e)
        {
            putTxt(b4_3);
        }

        private void button49_Click(object sender, EventArgs e)
        {
            putTxt(b4_4);
        }

        private void button48_Click(object sender, EventArgs e)
        {
            putTxt(b4_5);
        }

        private void button47_Click(object sender, EventArgs e)
        {
            putTxt(b4_6);
        }

        private void button46_Click(object sender, EventArgs e)
        {
            putTxt(b4_7);
        }

        private void button45_Click(object sender, EventArgs e)
        {
            putTxt(b4_8);
        }

        private void button44_Click(object sender, EventArgs e)
        {
            putTxt(b4_9);
        }

        private void button43_Click(object sender, EventArgs e)
        {
            putTxt(b4_10);
        }

        private void button66_Click(object sender, EventArgs e)
        {
            IsEventControl(controlMy.mode.press.HOME);
        }

        private void button67_Click(object sender, EventArgs e)
        {
            IsEnter = false;
            valueEnter = "";
            
        }



        //------------------------5 row key
        private void button59_Click(object sender, EventArgs e)
        {
            setLanguage();
        }

        private void button55_Click(object sender, EventArgs e)
        {

        }

        private void button54_Click(object sender, EventArgs e)
        {

        }

        private void button56_Click(object sender, EventArgs e)
        {
            putTxt(" ");
        }

        private void button65_Click(object sender, EventArgs e)
        {
            putTxt(b_kav);
        }

        private void button57_Click(object sender, EventArgs e)
        {
            IsEventControl(controlMy.mode.press.KeyLeft);
            textBox1.Focus();
            if (currentPositionCursor>0) currentPositionCursor--;

          textBox1.SelectionStart = currentPositionCursor;
            textBox1.SelectionLength = 0;
            
            
        }

        private void button58_Click(object sender, EventArgs e)
        {
            IsEventControl(controlMy.mode.press.KeyRight);
            textBox1.Focus(); int i = textBox1.Text.Length;
            if (currentPositionCursor<i) currentPositionCursor++;
            textBox1.SelectionStart = currentPositionCursor;
            textBox1.SelectionLength = 0;
            
        }

        private void button61_Click(object sender, EventArgs e)
        {
            putTxt(",");
        }

        private void button27_Click(object sender, EventArgs e)
        {
            putTxt(":");
        }

        private void button64_Click(object sender, EventArgs e)
        {
            putTxt(".");
        }

        private void button60_Click(object sender, EventArgs e)
        {
            IsEventControl(controlMy.mode.press.END);
        }
        #endregion

        private void setLevelHL()
        {
            if (curMode == controlMy.mode.keym.EngBig)
            {
                curMode = controlMy.mode.keym.Eng;
            }
            else if (curMode == controlMy.mode.keym.RusBig)
            {
                curMode = controlMy.mode.keym.Rus;
            }
            else if (curMode == controlMy.mode.keym.Rus)
            {
                curMode = controlMy.mode.keym.RusBig;
            }
            else if (curMode == controlMy.mode.keym.Eng)
            {
                curMode = controlMy.mode.keym.EngBig;
            }

            setTxtButton();
        }
        private void setTxtButton()
        {
            button1.Text = b00;
            button2.Text = b1;
            button3.Text = b2;
            button4.Text = b3;
            button5.Text = b4;
            button10.Text = b5;
            button9.Text = b6;
            button8.Text = b7;
            button7.Text = b8;
            button6.Text = b9;
            button12.Text = b0;
            button14.Text = b10;
            button13.Text = b11;

            button26.Text = b1b;
            button25.Text = b2b;
            button24.Text = b3b;
            button23.Text = b4b;
            button22.Text = b5b;
            button21.Text = b6b;
            button19.Text = b7b;
            button18.Text = b8b;
            button17.Text = b9b;
            button16.Text = b10b;
            button15.Text = b11b;
            button63.Text = b12b;

            button40.Text = b3_1;
            button39.Text = b3_2;
            button38.Text = b3_3;
            button37.Text = b3_4;
            button36.Text = b3_5;
            button35.Text = b3_6;
            button34.Text = b3_7;
            button33.Text = b3_8;
            button32.Text = b3_9;
            button31.Text = b3_10;
            button30.Text = b3_11;

            button52.Text = b4_1;
            button51.Text = b4_2;
            button50.Text = b4_3;
            button49.Text = b4_4;
            button48.Text = b4_5;
            button47.Text = b4_6;
            button46.Text = b4_7;
            button45.Text = b4_8;
            button44.Text = b4_9;
            button43.Text = b4_10;

            button59.Text = b5_setLanguage;
            button62.Text = b5_setLevel;
        }
        private void setLanguage()
        {
            if (curMode == controlMy.mode.keym.Eng)
            {
                curMode = controlMy.mode.keym.Rus;
            }
            else if (curMode == controlMy.mode.keym.Rus)
            {
                curMode = controlMy.mode.keym.Eng;
            }
            else if (curMode == controlMy.mode.keym.EngBig)
            {
                curMode = controlMy.mode.keym.RusBig;
            }
            else if (curMode == controlMy.mode.keym.RusBig)
            {
                curMode = controlMy.mode.keym.EngBig;
            }

            setTxtButton();
        }

    }
}
